public class Main {
    public static void main(String[] args) {
        //饿汉单例
        System.out.println("饿汉单例");
        System.out.println(EagerSingleton.getInstance().showInfo());
        System.out.println(EagerSingleton.getInstance().showInfo());
        //懒汉单例
        System.out.println("懒汉单例");
        System.out.println(LazySingleton.getInstance().showInfo());
        System.out.println(LazySingleton.getInstance().showInfo());
    }
}